
import { Modal, ModalFuncProps } from "antd";

const { confirm } = Modal;

export const asyncConfirm = (props: ModalFuncProps) => new Promise<void>((resolve, reject) => {
    confirm({
        ...props,
        onOk: () => { resolve() },
        onCancel: () => { reject() },
    });
});